/* BEM */
@mixin B($block) {
	$B: $namespace + '-' + $block !global;

	.#{$B} {
		@content;
	}
}

@mixin E($element) {
	$E: $element !global;
	$selector: &;
	$currentSelector: '';
	@each $unit in $element {
		$currentSelector: #{$currentSelector + '.' + $B + $element-separator + $unit + "," };
	}

	@at-root {
		#{$currentSelector} {
			@content;
		}
	}
}

@mixin M($modifier) {
	$selector: &;
	$currentSelector: "";

	@each $unit in $modifier {
		$currentSelector: #{$currentSelector + & + $modifier-separator + $unit + ","};
	}

	@at-root {
		#{$currentSelector} {
			@content;
		}
	}
}

@mixin when($state) {
	@at-root {
		&.#{$state-prefix + $state} {
			@content;
		}
	}
}

@mixin pseudo($pseudo) {
  @at-root #{&}#{':#{$pseudo}'} {
    @content
  }
}